Online documentation - Websydian v6.5
|
PaymentWebShop Parts
Introduction Implementing Other Uses Parts
This document describes the objects of the Websydian
PaymentWebShop pattern. PaymentWebShop
inherits from WebShop and extends WebShop
with entity attributes, functions and changes to functions
concerning online payment. Refer to the WebShop Parts section for a description
of the objects inherited from WebShop.
The following abstract entities are defined:
- The CreditCardTemplate
abstract entity is a template for a collection of common credit
card data fields. If the fields of the template matches the credit
card fields of the payment gateway protocol, it is convenient to
use the Fetch-view of CreditCardTemplate to populate the webinput
variable of SendToExternalServer Event handler
functions.
- The PaymentGateway abstract
entity is an inheritance placeholder for the
ExternalServerControl
pattern. PaymentGateway.Data.Application is
ancestor of the Shop entity.
In PaymentWebShop the Shop entity has been extended with
fields to control exchange of events with a payment gateway.
Furthermore, the Shop entity
inherits from PaymentWebShop.Abstract.PaymentGateway
and through this inheritance it is ensured that the correct
Shop instance is loaded when pages with external events
is generated.
The following page generators and event handlers are defined in
order to support online payments verified by a payment gateway:
- The Web.Ordering.Submit Payment function is a
PageGeneratorWithExternalEvent
function. The OK event handler models the external event
that is sent to a payment gateway when the web user accepts to pay
for the purchase.
- The Web.PaymentGateway.LoadOkPage function is a
ReceiveFromExternalServer
event handler. When activated, it calls the Order Confirmation
for User or Order Confirmation for Visitor page
generator, depending on whether a registered user has logged in or
not.
- The Web.PaymentGateawy.LoadErrorPage function is a
ReceiveFromExternalServer
event handler. When activated, it calls the
Web.Ordering.Payment Error page
generator.
The workflow diagram of the payment process is illustrated
below:
Payment Workflow Diagram
The call from Submit Payment.Ok to PaymentGateway is
not strictly within the model, as the Ok event is
invoked as an external server event rather than as a normal,
application-internal event.